import { View } from "@tarojs/components";
import { useEffect, useState } from "react";
// import TutorialSearch from "../index/components/TutorialSearch";
import { https, $route } from "@utils/index";
const FrequentlyAskedQuestions = () => {
  const [problemList, setProblemList] = useState<Questions[]>([]);
  useEffect(() => {
    getProblemList();
  }, []);
  // 问题列表
  const getProblemList = () => {
    https.getProblemList().then((res) => {
      setProblemList(res?.data?.data || []);
    });
  };
  return (
    <View className="bg-[#eee] box-border pb-[10px] min-h-[100vh] box-border pt-1 pb-1">
      {/* <TutorialSearch /> */}
      <>
        {problemList.map((item) => {
          return (
            <View
              key={item.id}
              onClick={$route.bind(null, {
                url: `/pages/mine/frequentlyAskedQuestionsDetail?id=${item.id}`,
              })}
              className="m-[30px] bg-[#fff] box-border p-[20px] rounded-[15px]"
            >
              <View className="text-[30px] font-bold mb-[10px] line-clamp-1">
                {item.name}
              </View>
              <View className="text-[26px] text-[#666] line-clamp-3">
                {item.desc}
              </View>
            </View>
          );
        })}
      </>
    </View>
  );
};
export default FrequentlyAskedQuestions;
